<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>


  <div th:replace="common/top">
  </div>

  <div id="Catalog">
    <div id="item_box">
      <div>
        <br>
        <br>
        <img id="item_pic" th:src= "${session.product.description}">
      </div>
      <div id="item_att">
        <br>
        <h2 th:text="${session.item.itemId}+${session.product.name}">
          ${sessionScope.item.itemId} ,"${sessionScope.product.name}"
        </h2>
        <br>

        <!--div th:text="${session.item.attribute1}">${sessionScope.item.attribute1}，
          ${sessionScope.item.attribute2}</div-->
        <div th:text="${session.item.attribute1}+${session.item.attribute2}">${sessionScope.item.attribute1}，
          ${sessionScope.item.attribute2}</div>
        <div th:text="${session.item.attribute3}">${sessionScope.item.attribute3}</div>
        <div th:text="${session.item.attribute4}+${session.item.attribute5}">${sessionScope.item.attribute4}，
          ${sessionScope.item.attribute5}</div>
        <br>

        <!-- rrrrrrrrrrrrrrrrr-->
        <!--c:if要改
        <c:if test="${sessionScope.item.quantity <= 0}">
          Back ordered.
        </c:if>
        <c:if test="${sessionScope.item.quantity > 0}">
          ${sessionScope.item.quantity} in stock.
        </c:if>-->
       <div th:text="${session.item.quantity}+' in stock.' ">

       </div>
        <br>
        <!-- rrrrrrrrrrrrrrrrr-->
        <!--fmt要改
        <fmt:formatNumber value="${sessionScope.item.listPrice}" pattern="$#,##0.00"/>-->
       <div th:text="'$'+${session.item.listPrice}">
         "${sessionScope.item.listPrice}"
       </div>
        </b>
        <br>
        <br>
        <br>
        <!--flag session和request的定义是避免刷新自增用的
        <%session.setAttribute("flag", 1);%>-->
        <a th:href= "@{addItemToCart(workingItemId=${session.itemId})}" class="Button">加入购物车</a>

         <br>
          <br>
        <div id="BackLink">
          <a  th:href="@{productForm(productId=${session.product.productId})}" th:text="${session.product.productId}" >
            回到${sessionScope.product.productId}
          </a>

            <!--a href="productForm?productId=${sessionScope.product.productId}">
                回到${sessionScope.product.productId}
            </a-->
        </div>
      </div>
    </div>
  </div>




  <div th:replace="common/bottom">
  </div>


</body>
</html>